<?php
/**
 * @version		1.0.1 audit
 * @author		PROinsurer
 * @website		www.proinsurer.com.ua
 */
defined('_JEXEC') or die('Restricted access');

// ШАПКА
include_once JPATH_COMPONENT .'/views/header.php';
//print_r($this->cur_sprav);
?>

<div class="row">
<div class="span12">	
	<div class="tabbable tabs-left" >
		
      <? include_once JPATH_COMPONENT .'/views/left_1.php'; ?>

		<div class="tab-content">
      <!--<ul class="ident_list">
      <? foreach ($this->ident_list AS $il) {
            foreach ($this->fstruct AS $fst) {
               $class = "ident_list_item";
               if ($il == $this->cur_ident) $class = "ident_list_item_curent";
               if ($il == $fst->id) {
                  $tmp_spr = array();
                  foreach ($this->fcompar->compar->ident[$il] AS $spr) {
                     $tmp_spr[] = $this->slName[$spr]; }
      ?>
                  <li><a class="<?=$class;?>" href="/private/audit?view=ident&ident=<?=$il;?>"><?=$fst->name;?></a> (<?=implode(',',$tmp_spr);?>)</li>
      <? } } } ?>
      </ul>-->
      
           <table class="table table-bordered">
              <thead>
                <tr>
                  <th width="4%"><nobr># / <abbr title="Количечство одинаковых строк">A</abbr></nobr></th>
                  <? foreach ($this->cur_sprav AS $val) { ?>
                     <th width="4%"><abbr title="<?=$this->slName[$val];?>"><?=substr($this->slName[$val], 0, 6);?></th>
                  <? } ?>
                  <th width="">Find File</th>
                  <!--<th width="">Find Base</th>-->
                </tr>
              </thead>
              <tbody>
                <?
                   $i = 0; $skip = 0; $rez_text = ''; $rez_col = '';
                   foreach ($this->data AS $d) {
                      if ($d->skip > 0) { $skip++; continue; }
                      if ($d->analog > 0) { continue; }
                      $rez_text = ''; $i++;
                      $rez_col = '';
                      foreach ($d->detail AS $spr=>$rez) {
                         //print_r($rez);
                         $rez_text = ''; $n = 1;
                         foreach ($rez->rez AS $r) {
                            $rez_text .= '<div class="goog-menuitem">'. $n++ .'. '. $r->name .'</div>'; }
                         $rez_col .= "<td><a href=\"#\" class=\"icon-circle-arrow-down find_list\"><sup> &nbsp; [". count($rez->rez) ."]</sup></a><div style=\"display:none;\">$rez_text </div></td>"; //$spr
                     }
                ?>
                <tr>
                  <td><nobr><?=$i;?> / <?=$d->rez->anlog_qty;?></nobr></td>
                  <?=$rez_col;?>
                  <td><?=$d->text_color;?></td>
                  <!--<td style="font-family: Tahoma; font-size: 9px; padding: 1px 4px; line-height: 14px;"><?=$rez_text;?></td>-->
                </tr>
                <? } ?>
              </tbody>
            </table>
            
            <div class="alert alert-error">Пропщенно пустых значений: <strong><?=$skip;?></strong></div>
      
<pre><?  print_r($this->data);   // print_r($this->fcompar->compar->ident); ?></pre>
			
			<div class="active" id="tab3">
			</div>

      </div>
      
   </div>
</div>
</div>

<script>

jQuery(document).ready(function(){
   
   $('.find_list').click( function () {
         var obj = $(this);
         setTimeout(function() {
            $("#findWind").css({'top': (obj.offset().top+22)+'px','left': (obj.offset().left-15)+'px', 'display':'block'});
            $('#ggg_find').html( obj.next().html() );
            $('#preparat_find').attr({
                  'preparat_id' : '0',
                  'rec_id'      : 'id',
                  'value'       : ''
               }).focus();
            //obj.addClass('sfinds_activ');
         }, 100);
         return false;
      }
   );
   
});

</script>


<?
   // -- ПОДВАЛ ----------------------------------------------------------------
   include_once JPATH_COMPONENT .'/views/futer.php';
?>

<?
   //  -- Файл с Окошками... ---------------------------------------------------
   include_once JPATH_COMPONENT .'/views/windows.php';
?>

<?
   //  -- Файл со Скриптами... -------------------------------------------------
   include_once JPATH_COMPONENT .'/views/default.js.php';
?>
